home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / win_q_t / trem.zip / HANDLER.C < prev    next >
Text File  |  1991-05-11  |  2KB  |  65 lines

  1. /************************************************************************
  2.  *
  3.  *    Copyright (c) 1991 Microsoft Corporation.  All Rights Reserved.
  4.  *
  5.  *-----------------------------------------------------------------------
  6.  *
  7.  *     Project:  Windows Terminal Example
  8.  *
  9.  *      Module:  handler.c
  10.  *
  11.  *      Author:  Bryan A. Woodruff (baw)
  12.  *
  13.  *
  14.  *     Remarks:  Timer Handler
  15.  *
  16.  *   Revisions:
  17.  *     01.00.000  5/ 9/91 baw   Wrote it.
  18.  *
  19.  ***********************************************************************/
  20.  
  21. #include "terminal.h"
  22.  
  23. /************************************************************************
  24.  *  WORD FAR PASCAL TimerHandler( HWND hWnd, WORD wMsg, int nIdEvent,
  25.  *                                DWORD dwTime )
  26.  *
  27.  *  Description:
  28.  *     This is a timer handler.  It checks the COM event flags
  29.  *     and posts a message to the associated window.
  30.  *
  31.  *  Comments:
  32.  *      5/ 8/91  baw  Wrote it
  33.  *      5/11/91  baw  Modifications to make it "nice".
  34.  *
  35.  ************************************************************************/
  36.  
  37. WORD FAR PASCAL TimerHandler( HWND hWnd, WORD wMsg, int nIdEvent,
  38.                               DWORD dwTime )
  39. {
  40.    int        i ;
  41.    WORD       wEvent ;
  42.    EVENT FAR  *lpEvent ;
  43.  
  44.    for (i = 0; i < MAXEVENTS; i++)
  45.    {
  46.       lpEvent = &aEvents[i] ;
  47.       if ((!lpEvent -> fPostFlag) && (NULL != lpEvent -> hWnd))
  48.       {
  49.          wEvent = *(lpEvent -> lpEventPtr) ;
  50.          if (wEvent & lpEvent -> wEventMask)
  51.          {
  52.             PostMessage( lpEvent -> hWnd, lpEvent -> wMsg, wEvent, 0L ) ;
  53.             lpEvent -> fPostFlag = TRUE ;
  54.          }
  55.       }
  56.    }
  57.    return ( 1 ) ;
  58.  
  59. } /* end of TimerHandler() */
  60.  
  61. /************************************************************************
  62.  * End of File: handler.c
  63.  ************************************************************************/
  64.  
  65.